﻿<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>登录处理页面</title>
</head>
<body>
  
  <%
		//处理字符编码集
		request.setCharacterEncoding("utf-8");
		//获取用户名 密码 
		String username = request.getParameter("userName");
		String pwd = request.getParameter("pwd");
  
		if("小明".equals(username) && "12345".equals(pwd)){
			//将数据 存入 session 
			session.setAttribute("userName", username);
			//重定向  
			response.sendRedirect("admin.jsp");
		}else{
			response.sendRedirect("index.jsp");
		}
  
  %>
  
  
  
    </body>
</html>
